/***********圈子***********/
/*编辑*/
function u_circle_show(obj,id,w,h){
	var index = layer.open({
		type : 2,
		title : '圈子详情',
		shadeClose : true,
		shade : 0.8,
		content : "circleshow?circleid=" + id
	});
	layer.full(index);
}

/*删除*/
function u_circle_delete(obj,id){
	layer.confirm('确认删除？', {
		btn: ['确认','取消'], 
		shade: false
	},
	function(){
		$.ajax({
			type : "POST",
			url : "u_circle-delete",
			data : "id=" + id,
			error : function() {
				layer.msg('操作失败', {icon:5,time:1000});
			},
			success : function(msg) {
				layer.msg('已删除 ' + msg.information, {icon:6,time:1000});
				$(obj).parents("body").find(".btn-refresh").click();
			}
		});
	},
	function(){
		layer.msg('未删除', {icon:5,time:1000});
	});	
}

function circle_post_list(obj,id){
	var index = layer.open({
		type : 2,
		title : '查看',
		shadeClose : true,
		shade : 0.8,
		content : "circlepostlist?circleid=" + id
	});
	layer.full(index);
}

function circle_against_list(obj,id){
	var index = layer.open({
		type : 2,
		title : '查看',
		shadeClose : true,
		shade : 0.8,
		content : "circleagainstlist?circleid=" + id
	});
	layer.full(index);
}

function u_circle_against_show(obj,id){
	var index = layer.open({
		type : 2,
		title : '查看',
		shadeClose : true,
		shade : 0.8,
		content : "circleagainstdetail?againstid=" + id
	});
	layer.full(index);
}


/***********圈子帖子***********/
/*查看*/
function u_circle_post_show(obj,id,w,h){
	var index = layer.open({
		type : 2,
		title : '查看',
		shadeClose : true,
		shade : 0.8,
		content : "circlepostshow?circlepostid=" + id
	});
	layer.full(index);
}

/*删除*/
function u_circle_post_delete(obj,id){
	layer.confirm('确认删除？', {
		btn: ['确认','取消'], 
		shade: false
	},
	function(){
		$.ajax({
			type : "POST",
			url : "u_circle_post-delete",
			data : "id=" + id,
			error : function() {
				layer.msg('操作失败', {
					icon : 5,
					time : 1000
				});
			},
			success : function(msg) {
				layer.msg('已删除 ' + msg.information, {
					icon : 6,
					time : 1000
				});
				$(obj).parents("body").find(".btn-refresh").click();
			}
		});
	}, function() {
		layer.msg('未删除', {
			icon : 5,
			time : 1000
		});
	});
}

function showpostreply(circlepostid){
	var index = layer.open({
		type : 2,
		title : '帖子回复列表',
		shadeClose : true,
		shade : 0.8,
		content : "circlepostreplyshow?circlepostid=" + circlepostid
	});
	layer.full(index);
}

/*删除帖子的回复*/
function circlepostreplydelete(obj,id){
	layer.confirm('确认删除？', {
		btn: ['确认','取消'], 
		shade: false
	},
	function(){
		$.ajax({
			type : "POST",
			url : "u_post_reply-delete",
			data : "replyid=" + id,
			error : function() {
				layer.msg('操作失败', {
					icon : 5,
					time : 1000
				});
			},
			success : function(msg) {
				layer.msg('已删除 ' + msg.information, {
					icon : 6,
					time : 1000
				});
				$(obj).parents("body").find(".btn-refresh").click();
			}
		});
	}, function() {
		layer.msg('未删除', {
			icon : 5,
			time : 1000
		});
	});
}


/*添加*/
function u_circle_cate_add(title, url, w, h) {
	var index = layer.open({
		type : 2,
		title : title,
		shadeClose : true,
		shade : 0.8,
		content : url
	});
	layer.full(index);
}

/*删除*/
function u_circlecate_delete(obj,id){
	layer.confirm('确认删除？', {
		btn: ['确认','取消'], 
		shade: false
	},
	function(){
		$.ajax({
			type : "POST",
			url : "u_circle_cate-delete",
			data : "id=" + id,
			error : function() {
				layer.msg('操作失败', {icon:5,time:1000});
			},
			success : function(msg) {
				layer.msg('已删除 ' + msg.information, {icon:6,time:1000});
				$(obj).parents("body").find(".btn-refresh").click();
			}
		});
	},
	function(){
		layer.msg('未删除', {icon:5,time:1000});
	});	
}

function showcirclemember(circleid){
	var index = layer.open({
		type : 2,
		title : '成员列表',
		shadeClose : true,
		shade : 0.8,
		content : "circlememberlist?circle_id=" + circleid
	});
	layer.full(index);
}

